Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PostgreSqlPlatform.php #626

Closed
wants to merge 5 commits into from
Closed

Update PostgreSqlPlatform.php #626

wants to merge 5 commits into from

Conversation

x42p
Copy link
Contributor

@x42p x42p commented Jun 29, 2014

If the database have different schemes, with objects, that the actual logged in user has no rights, the existing statements will collect all objects (sequences and tables) and try to read them in later steps. This will throws exceptions. The reason for that is the fact, that both procedures getListSequencesList() and getListTablesSQL() will receive all known database objects from postgres catalogs. But the actual logged-in user, maby has no read permissions to object inside other scheme-owner. The additional parts inside both sql-statements will reduce the result to only objects that the user are able to see.

If the database have different schemes, with objects, that the actual logged in user has no rights, the existing statements will collect all objects (sequences and tables) and try to read them in later steps. This will throws exceptions. The reason for that is the fact, that both procedures getListSequencesList() and getListTablesSQL() will receive all known database objects from postgres catalogs. But the actual logged-in user, maby has no read permissions to object inside other scheme-owner. The additional parts inside both sql-statements will reduce the result to only objects that the user are able to see.
@doctrinebot
Copy link

Hello,

thank you for creating this pull request. I have automatically opened an issue
on our Jira Bug Tracker for you. See the issue link:

http://www.doctrine-project.org/jira/browse/DBAL-930

We use Jira to track the state of pull requests and the versions they got
included in.

WHERE relkind = 'S'
AND n.oid = c.relnamespace
AND (n.nspname NOT LIKE 'pg_%' AND n.nspname != 'information_schema')
AND pg_table_is_visible(oid) is true";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build broke because column reference needs to be c.oid.

x42p added 2 commits July 3, 2014 20:46
missing table identifier added
correct table identifier
@deeky666
Copy link
Member

@x42p Testsuite is still failing. Can you please have a look? Thanks.

@milokmet
Copy link
Contributor

@guilhermeblanco Wouldn't be better and more readle to replace the pg_catalog tables by the information_schema tables/views that shows only the objects that are granted to use for the current logged user?

x42p added 2 commits July 23, 2014 22:59
I take the guess an use the information_schema. It makes it more clear and simple
some format changes to trigger travis-cl once more again
@deeky666
Copy link
Member

@x42p thanks for your contribution, continued work in #702.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants